package wusiyuan.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import wusiyuan.service.UpdateThePasswordService;
import wusiyuan.service.impl.UpdateThePasswordServiceImpl;

/**
 * Servlet implementation class UpdateThePasswordServlet
 */
public class UpdateThePasswordServlet extends HttpServlet {
	private UpdateThePasswordService ut = new UpdateThePasswordServiceImpl();

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		String password = request.getParameter("password");
		String username = request.getParameter("username");
		System.out.println(password + "\n" + username);
		Integer i = ut.updateThePassword(password, username);
		System.out.println(i);
		

	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}

}
